<include file="Public:pageHeader"/>
<!--主区域-->
<div class="mainBox on">
    <!--搜索-->
    <div class="wrapper">
        <ul class="search-item">
            <li class="search-type <if condition="($st eq 0)">on</if> " value="0" >智能搜索</li>
            <li class="search-type <if condition="($st eq 1)">on</if> " value="1">商标名</li>
            <li class="search-type <if condition="($st eq 2)">on</if> " value="2">注册号</li>
            <li class="search-type <if condition="($st eq 3)">on</if> " value="3">申请人</li>
            <li class="search-model">
                <select id="search-model">
                    <option value="0" <if condition="($sm eq 0)">selected=true</if> >搜索模式</option>
                    <option value="1" <if condition="($sm eq 1)">selected=true</if> >开头包含</option>
                    <option value="2" <if condition="($sm eq 2)">selected=true</if> >结尾包含</option>
                    <option value="3" <if condition="($sm eq 3)">selected=true</if> >模糊搜索（默认）</option>
                    <option value="4" <if condition="($sm eq 4)">selected=true</if> >精准匹配</option>
                </select>
            </li>
            <input type="hidden" id="search-type-input" value="{$st}">
        </ul>
    </div>
    <div class="wrapper">
        <div class="search-input">
            <span class="search-input-icon"> </span>
            <span class="search-input-text"> <input class="search-content" id="search-keywords" placeholder="请输入你想要查询的商标名称" value="{$keywords}"></span>
            <span class="search-input-button">
					<button class="search-button" id="search-button">搜索</button>
				</span>
        </div>
        <div class="search-help">
            <button class="search-help-button">帮我免费找标</button>
        </div>
    </div>
    <!-- 首页 -->
    <div class="shouye">
        <div class="wrapper">
            <div class="choose-box">
                <div class="choose-price">
                    <label class="name">价格范围</label>
                    <label class="unlimit <eq name="priceId" value="0">cur</eq>"><a href="/index/index/c/0-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                    <ul class="price">
                        <volist name="priceItem" id="vo" key="k">
                            <li class="i1 <if condition="($priceId eq $k)">cur</if>"><a href="/index/index/c/{$k}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.name}</a></li>
                        </volist>
                        <li class="no_h">
                            <input type="text" class="no_h" id="min-price" placeholder="0" value="{$minprice}"/> ~
                            <input type="text" class="no_h" id="max-price" placeholder="0" value="{$maxprice}"/>
                            <input type="button" class="no_h" id="self-price-btn" value="确定"/>
                        </li>
                    </ul>
                </div>
                <div class="choose-type">
                    <label class="name">商标类别</label>
                    <label class="unlimit <eq name="cateId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-0-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                    <ul class="type">
                        <volist name="category" id="vo" key="k">
                            <li class="i2 <if condition="($cateId eq $vo['id'])">cur</if>"><a href="/index/index/c/{$priceId}-{$vo.id}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.cate_sn}-{$vo.cate_name}</a></li>
                        </volist>
                    </ul>
                </div>
                <notempty name="group">
                <div class="choose-group-type">
                    <label class="name">类似群组</label>
                    <label class="unlimit <eq name="groupId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-{$cateId}-0-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                    <ul class="group">
                        <volist name="group" id="vo" key="k">
                            <li class="i8 <if condition="($groupId eq $vo['group_sn'])">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$vo.group_sn}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.group_sn}</a></li>
                        </volist>
                    </ul>
                </div>
                </notempty>
                <div class="hide">
                    <div class="choose-fuwu">
                        <label class="name">产品/服务</label>
                        <label class="unlimit cur">不限</label>
                        <ul class="fuwu">
                            <li class="no_h">
                                <input type="text" class="min-price" placeholder="多个产品/服务之间请加空格" style="width:270px"/>
                            </li>
                        </ul>
                    </div>
                    <div class="choose-register-apply-count">
                        <label class="name">注册人申请量</label>
                        <label class="unlimit <eq name="applyCountId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-0-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                        <ul class="apply-count">
                            <volist name="applyCountItem" id="vo" key="k">
                                <li class="i3 <if condition="($applyCountId eq $k)">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$k}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.name}</a></li>
                            </volist>
                        </ul>
                    </div>
                    <div class="choose-combined-type">
                        <label class="name">组合类型</label>
                        <label class="unlimit <eq name="combinedTypeId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-0-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                        <ul class="combined-type">
                            <volist name="combinedTypeItem" id="vo" key="k">
                                <li class="i4 <if condition="($combinedTypeId eq $k)">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$k}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.name}</a></li>
                            </volist>
                        </ul>
                    </div>
                    <div class="choose-string-count">
                        <label class="name">商标字数</label>
                        <label class="unlimit <eq name="stringCountId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-0-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                        <ul class="string-count">
                            <volist name="stringCountItem" id="vo" key="k">
                                <li class="i5 <if condition="($stringCountId eq $k)">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$k}-{$applyerTypeId}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.name}</a></li>
                            </volist>
                        </ul>
                    </div>
                    <div class="choose-applyer-type">
                        <label class="name">申请人类型</label>
                        <label class="unlimit <eq name="applyerTypeId" value="0">cur</eq> "><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-0-{$registedYearsId}-{$structTypeId}{$otherparams}">不限</a></label>
                        <ul class="applyer-type">
                            <volist name="applyerTypeItem" id="vo" key="k">
                                <li class="i6 <if condition="($applyerTypeId eq $k)">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$k}-{$registedYearsId}-{$structTypeId}{$otherparams}">{$vo.name}</a></li>
                            </volist>
                        </ul>
                    </div>
                    <div class="choose-registed-years">
                        <label class="name">注册年限</label>
                        <label class="unlimit <eq name="registedYearsId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-0-{$structTypeId}{$otherparams}">不限</a></label>
                        <ul class="registed-years">
                            <volist name="registedYearsItem" id="vo" key="k">
                                <li class="i7 <if condition="($registedYearsId eq $k)">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$k}-{$structTypeId}{$otherparams}">{$vo.name}</a></li>
                            </volist>
                        </ul>
                    </div>
                    <div class="choose-struct-type">
                        <label class="name">名称结构</label>
                        <label class="unlimit <eq name="structTypeId" value="0">cur</eq>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-0{$otherparams}">不限</a></label>
                        <ul class="struct-type">
                            <volist name="structTypeItem" id="vo" key="k">
                                <li class="i8 <if condition="($structTypeId eq $k)">cur</if>"><a href="/index/index/c/{$priceId}-{$cateId}-{$groupId}-{$applyCountId}-{$combinedTypeId}-{$stringCountId}-{$applyerTypeId}-{$registedYearsId}-{$k}{$otherparams}">{$vo.name}</a></li>
                            </volist>
                        </ul>
                    </div>
                </div>
                <div class="choose-hide">
                    <span class="hide-button">隐藏选项 <img src="_STATIC_/img/search-shouqi@2x.png"/></span>
                </div>
                <div class="choose-show">
                    <span class="show-button">更多选项 <img src="_STATIC_/img/search-shouqi@2x.png" style="transform:rotateX(180deg)"/></span>
                </div>
            </div>
        </div>
        <!-- 排序 -->
        <div class="wrapper">
            <div class="order-box">
                <span class="common-order-button order-button <?php if(empty($_GET['order']) || $_GET['order'] == 1){echo 'selected';} ?>" data="<?php if(empty($_GET['order']) ){ echo 1;}else{ echo 0;}?>" style="cursor: pointer;">
                综合排序 <?php if(in_array($_GET['order'],[2,3])): ?><img src="_STATIC_/img/order-icon@2x.png"/><?php elseif(empty($_GET['order'])): ?><img src="_STATIC_/img/order-asc@2x.png"/><?php elseif($_GET['order'] == 1): ?><img src="_STATIC_/img/order-desc@2x.png"/> <?php endif;?>
                </span>
                <span class="price-order-button order-button <in name='Think.get.order' value='2,3'>selected</in>" data="<?php if($_GET['order'] == 2){ echo 3;}else{ echo 2;}?>" style="cursor: pointer;">
                价格 <?php if(in_array($_GET['order'],['',0,1])): ?><img src="_STATIC_/img/order-icon@2x.png"/><?php elseif($_GET['order'] == 2): ?><img src="_STATIC_/img/order-asc@2x.png"/><?php elseif($_GET['order'] == 3): ?><img src="_STATIC_/img/order-desc@2x.png"/> <?php endif;?>
                </span>
                <span class="show-only-button"><input type="checkbox" class="show-only" value="1" <eq name='Think.get.group' value='1'>checked</eq>> 同名标仅显示1个类别</span>
            </div>
        </div>

        <!-- 商品列表 -->
        <div class="wrapper">
            <div class="goods-box">
                <ul>
                    <notempty name="trademarks">
                        <volist name="trademarks" id="vo" key="k">
                            <li class="goods">
                                <a href="/trademarks/detail/tid/{$vo.id}">
                                    <div><img src="{$vo.trademark_image}" class="goods-image"></div>
                                    <p class="goods-title">{$vo.trademark_name}</p>
                                    <p class="goods-cate">{$vo.cate_info.cate_sn}类-{$vo.cate_info.cate_name}</p>
                                    <p><span class="goods-price">￥{$vo.trademark_price}</span><span class="goods-num">100个产品/服务</span></p>
                                </a>
                                <div class="online-service">在线咨询</div>
                            </li>
                        </volist>
                        <else/>
                    </notempty>
                    <empty name="trademarks">
                        <li style="text-align:center; color:#999999">抱歉～未查找到相关商标、请换个关键词查找！！！</li>
                    </empty>
                </ul>
            </div>
        </div>
        <!-- 分页列表 -->
        <div class="wrapper">
            <div class="page-box">
                <notempty name="trademarks">
                {$page}
                </notempty>
            </div>
        </div>
    </div>
</div>
<!--右侧浮窗-->
<include file="Public:rightFloatBox" />
<!--购买浮窗-->
<include file="Public:buyFloatBox" />
<!--底部区域-->
<include file="Public:pageFooter" />
</body>
</html>
<script type="text/javascript" src="_STATIC_/js/index.js" ></script>
<script type="text/javascript">
    $(function (){
        //自定义价格搜索
        var c = parseInt("{$c}");
        var priceId = "{$priceId}";
        var cateId = "{$cateId}";
        var groupId = "{$groupId}";
        var applyCountId = "{$applyCountId}";
        var applyerTypeId = "{$applyerTypeId}";
        var stringCountId = "{$stringCountId}";
        var combinedTypeId = "{$combinedTypeId}";
        var registedYearsId = "{$registedYearsId}";
        var structTypeId = "{$structTypeId}";
        var WWW = "";
        $('#self-price-btn').click(function(){
            var searchtype = $("#search-type-input").val();
            var searchmodel = $("#search-model option:selected").val();
            var searchkeywords = $("#search-keywords").val();
            var minprice = $("#min-price").val();
            var maxprice = $("#max-price").val();
            var flex = /^[0-9]*$/;
            if( flex.test(minprice) == false ){
                return alert("最小金额需为正整数！");
            }
            if( flex.test(maxprice) == false ){
                return alert("最大金额需为正整数！");
            }
            var reqUrl = WWW + "/index/index";
            if( c == 1 ){
                reqUrl += "/c/"+priceId+"-"+cateId+"-"+groupId+"-"+applyCountId+"-"+combinedTypeId+"-"+stringCountId+"-"+applyerTypeId+"-"+registedYearsId+"-"+structTypeId+"";
            }
            reqUrl +=( minprice ? "/min/" + minprice : "" );
            reqUrl +=( maxprice ? "/max/" + maxprice : "" );
            reqUrl +=( searchtype ? "/st/" + searchtype : "" );
            reqUrl +=( searchmodel ? "/sm/" + searchmodel : "" );
            reqUrl +=( searchkeywords ? "/k/" + searchkeywords : "" );
            window.location.href = reqUrl;
        })

        // 搜索框上面选中效果
        $('.mainBox .search-item .search-type').click(function(){
            $(this).addClass('on').siblings().removeClass('on');
            var value = parseInt($(this).attr("value"));
            $("#search-type-input").val(value);
        })
        //搜索框搜索
        $('#search-button').click(function(){
            var searchtype = $("#search-type-input").val();
            var searchmodel = $("#search-model option:selected").val();
            var searchkeywords = $("#search-keywords").val();
            if( searchkeywords == "" ){
                return alert("请输入要搜索的内容！");
            }
            var reqUrl = WWW + "/index/index";
            reqUrl +=( searchtype ? "/st/" + searchtype : "" );
            reqUrl +=( searchmodel ? "/sm/" + searchmodel : "" );
            reqUrl +=( searchkeywords ? "/k/" + searchkeywords : "" );
            window.location.href = reqUrl;
        })
        //获取？后参数
        $.getSearchUrlParams = function(k){
            var search = window.location.search.substr(1);
            var reg = new RegExp("(^|&)"+ k +"=([^&]*)(&|$)");
            var matchs = search.match(reg);
            if(matchs != null){
                return unescape(matchs[2]);
            }
            return "";
        }
        //group by
        $("input[type=checkbox].show-only").click(function(){
            var order  = $.getSearchUrlParams("order");
            var orderStr = order ? "&order="+order : "";
            var pathname = window.location.pathname;
            if($(this).prop("checked")){
                window.location.href = pathname + "?group=1" + orderStr;
            }else{
                if(orderStr){
                    orderStr = orderStr.replace('&','?');
                }
                window.location.href = pathname + orderStr;
            }
        })
        //order by
        $("span.order-button").click(function(){
            var group = $.getSearchUrlParams("group");
            var groupStr = group ? "&group="+group : "";
            var pathname = window.location.pathname;
            window.location.href = pathname + "?order=" + $(this).attr('data') + groupStr;
        })
    })
</script>